home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Special 16 / AMIGAplus Sonderheft 16 (1998)(ICP)(DE)[!].iso / pd / anwendungen / ispell-3.1.18bin / interfaces / guispell-1.1 / rexx / ced / quickwordspell.ced next >
Text File  |  1995-09-21  |  2KB  |  66 lines

  1. /*
  2.  *  QuickWordSpell.ced - ARexx Program to spell check a word while in CED!
  3.  *  Requires ISpell version 3.1ljr (or later) with ARexx Server Mode,
  4.  *  GUISpell version 1.0, CED version 2.12 and PingServer (from VLT).
  5.  *
  6.  *  This version just looks for GUISpell if the word is not found.
  7.  *  This version can be used to setup a spell check as you type
  8.  *  system under CED and possibly other text editors.  Under CED, 
  9.  *  just define a macro for the space bar.  Have the macro perform 
  10.  *  the following: `Send Dos/ARexx command...' QuickWordSpell, space.
  11.  *
  12.  *  Started around: Sat Jan 05 03:51:37 1991  LJR
  13.  *  Hacked on a bit: Thu Jan 17 17:17:26 1991  LJR
  14.  *  Finished: Fri Feb  1 06:41:08 1991  LJR
  15.  *  Updated for OS 2.04: LJR  Sat Nov 23 17:40:36 1991
  16.  *  Updated for IGadSpell: LJR  Sun Dec  8 07:19:48 1991
  17.  *  Reworked for GUISpell public release: Thu Mar 26 02:12:39 1992 LJR
  18.  *  Copyright © 1991, 1992  Loren J. Rittle
  19.  *  Use as you will, just document your changes and keep my copyright
  20.  *  notice intact.
  21.  *
  22.  *  Loren J. Rittle
  23.  *  rittle@comm.mot.com
  24.  */
  25. options results
  26.  
  27. if ~show(ports, 'IRexxSpell') then
  28.   do
  29.     address command 'run <nil: >nil: ispell -r <nil: >nil:'
  30.     address command waitforport 'IRexxSpell'
  31.   end
  32.  
  33. status 87; bytepos = result;
  34. status 55; line = result;
  35. parse var line curline '0a'x
  36.  
  37. curpos = 0
  38. do forever
  39.   curpos=pos('09'x, curline, curpos+1)
  40.   if curpos == 0 then break
  41.   curline = overlay(' ', curline, curpos)
  42. end
  43.  
  44. do i = 1 to words(curline)
  45.   if wordindex(curline, i)-1 > bytepos then
  46.     break
  47.   end
  48.  
  49. item = compress( word( curline, i-1 ), ' ~`,./<>?;:"[]{}!@#$%^&*()+|=\' )
  50.  
  51. if item = '' then exit
  52.  
  53. address 'IRexxSpell' quickcheck item
  54. if result = 'bad' then do
  55. /* Uncomment the following if you want QuickWordSpell.ced to fire up
  56.    GUISpell on a spelling error. */
  57. /*    if pos('GUISpell',(show(ports))) = 0 then do
  58.         address command 'run <nil: >nil: GUISpell <nil: >nil:'
  59.         address command waitforport 'GUISpell'
  60.       end*/
  61.     if pos('GUISpell',(show(ports))) ~= 0 then
  62.       address 'GUISpell' check item
  63.     address 'PingServer' beep
  64.   end
  65. exit
  66.